package com.hao.product.app.model.dto.product;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author haoge
 * @version 1.0
 * @date 2023/5/22 16:02
 */
@Data
public class ProductAddRequest implements Serializable {

    private static final long serialVersionUID = 3779806904844371320L;

    /**
     * 商品名称
     */
    @NotNull (message = "请输入商品名称")
    @NotBlank (message = "请输入商品名称")
    @Length (max = 1024, message = "名称过长")
    private String name;

    /**
     * 商品图片
     */
    private String image;

    /**
     * 商品描述
     */
    private String detail;

    /**
     * 分类id
     */
    @NotNull (message = "请输入商品类别")
    @NotBlank(message = "请输入商品类别")
    private String categoryIds;

    /**
     * 商品价格
     */
    @NotNull(message = "请输入商品价格")
    @Min(value = 0,message = "价格不能小于零")
    private Double price;

    /**
     * 商品库存
     */
    @NotNull(message = "请输入库存")
    private Integer stock;

    /**
     * 商品状态 0-下架 1-上架
     */
    @NotNull(message = "请选择是否上架")
    private Integer status;

}
